

(defmacro while (test-form inc-form &rest body )

  `(tagbody
     start-tag
     (progn
       (print x)
       ,@body 
       (print "looped")
       ,inc-form)
     (if ,test-form
	 (go start-tag))))



 (let ((x 0))
   (while (< x 10) (setf x (+ x 1))
 	 (print "First part")
 	 (print "Second part")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defmacro for (dec-form 
	       test-form 
	       inc-form 
	       &rest rest)

  ;; allow one set of parenthesis to be used
  ;; if only one variable needs to be declared
  (if (not (listp (car dec-form)))
      (setf dec-form (list dec-form)))

  `(let ,dec-form
     (tagbody
      start-tag
	(if ,test-form
	    (progn
	      ,@rest
	      (setf ,(caar dec-form) ,inc-form)
	      (go start-tag))))))


(print (macroexpand `(for (i 0) (< i 10) (+ i 1) 
     (print i))))


(for (i 0) (< i 10) (setf i (+ i 1)) 
     (print i))




